home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Shareware Plus / Developers / PlayerPRO 4.5.3 Dev.Kit / MADH Library 4.2 / Libraries & Headers / MAD.h next >
Encoding:
Text File  |  1996-07-30  |  3.7 KB  |  167 lines  |  [TEXT/CWIE]

  1. /********************                        ***********************/
  2. //
  3. //    Player PRO 4.5x -- MAD Music Driver Definition -
  4. //
  5. //    Library Version 4.02
  6. //
  7. //    To use with MAD Library for Mac Think, Symantec, CodeWarrior and MPW
  8. //
  9. //    Antoine ROSSET
  10. //    16 Tranchees
  11. //    1206 GENEVA
  12. //    SWITZERLAND
  13. //
  14. //    Thank you for your interest in PlayerPRO !
  15. //
  16. //    FAX:            (+41 22) 346 11 97
  17. //    PHONE:         (+41 79) 203 74 62
  18. //    Internet:         rosset@dial.eunet.ch
  19. //
  20. /********************                        ***********************/
  21.  
  22. #ifndef __MADH__
  23. #define __MADH__
  24.  
  25. #if defined(powerc) || defined (__powerc)
  26. #pragma options align=mac68k
  27. #else
  28. #if !defined(THINK_C)
  29. #pragma options align=mac68k
  30. #endif
  31. #endif
  32.  
  33. #define DEFAULT_VOLFADE        300
  34.  
  35. // ***    
  36. // ***    PATTERN DESCRIPTION
  37. // ***    
  38.  
  39. struct Cmd                            // COMMAND
  40. {
  41.     Byte    ins;                        // Instrument no        0x00: no ins cmd
  42.     Byte     note;                    // Note, see table        0xFF : no note cmd
  43.     Byte     cmd;                    // Effect cmd
  44.     Byte     arg;                    // Effect argument
  45.     Byte    vol;                    // Volume                0xFF : no volume cmd
  46.     Byte    unused;
  47. };
  48. typedef struct Cmd Cmd;
  49.  
  50. struct PatHeader                    // HEADER
  51. {
  52.     long    size;                    // Length of pattern: standard = 64
  53.     long    compMode;                // Compression mode, none = 'NONE'
  54.     char    name[ 32];
  55.     long    patBytes;                // Pattern Size in Bytes
  56.     long    unused2;
  57. };
  58. typedef struct PatHeader PatHeader;
  59.  
  60. struct PatData                        // DATA STRUCTURE : HEADER + COMMANDS
  61. {                                    // Pattern = 64 notes to play
  62.     PatHeader    header;
  63.     Cmd        Cmds[];
  64. };
  65. typedef struct PatData PatData;
  66.  
  67.  
  68.  
  69. // ***    
  70. // ***    INSTRUMENT DESCRIPTION
  71. // ***    
  72.  
  73.  
  74. struct sData                                // SAMPLE
  75. {
  76.     long                 size;                // Sample length
  77.     long                loopBeg;            // LoopStart
  78.     long                loopSize;            // LoopLength
  79.     Byte                 vol;                // Base volume
  80.     unsigned short        c2spd;                // c2spd
  81.     Byte                loopType;
  82.     Byte                amp;                // 8 or 16 bits
  83.     Byte                panning;
  84.     char                relNote;
  85.     char                 name[ 32];            // Sample name
  86.     Ptr                    data;                // Used only in memory, not in files
  87. };
  88. typedef struct sData sData;
  89.  
  90. struct EnvRec                // Volume Enveloppe
  91. {
  92.     short     pos;                // pos
  93.     short    val;                // val
  94. };
  95. typedef struct EnvRec EnvRec;
  96.  
  97. enum
  98. {
  99.     EF_ON            = 1,
  100.     EF_SUSTAIN    = 2,
  101.     EF_LOOP        = 4
  102. };
  103.  
  104. struct InstrData                // INSTRUMENT
  105. {
  106.     char     name[ 32];            // instrument name
  107.     Byte     type;                // Instrument type = 0
  108.  
  109.     short    numSamples;        // Number of samples in instrument
  110.  
  111.     /**/
  112.  
  113.     Byte        what[ 96];        // Sample number for all notes
  114.     EnvRec         volEnv[ 12];    // Points for volume envelope
  115.     EnvRec        pannEnv[ 12];    // Points for panning envelope
  116.     
  117.     Byte    volSize;            // Number of volume points
  118.     Byte    pannSize;            // Number of panning points
  119.     
  120.     Byte    volSus;                // Volume sustain point
  121.     Byte    volBeg;                // Volume loop start point
  122.     Byte    volEnd;                // Volume loop end point
  123.     
  124.     Byte    pannSus;            // Panning sustain point
  125.     Byte    pannBeg;            // Panning loop start point
  126.     Byte    pannEnd;            // Panning loop end point
  127.  
  128.     Byte    volType;            // Volume type: bit 0: On; 1: Sustain; 2: Loop
  129.     Byte    pannType;            // Panning type: bit 0: On; 1: Sustain; 2: Loop
  130.     
  131.     unsigned short    volFade;    // Volume fadeout
  132.     
  133.     Byte    vibDepth;
  134.     Byte    vibRate;
  135. };
  136. typedef struct InstrData InstrData;
  137.  
  138.  
  139.  
  140. // ***    
  141. // ***    MAD FILE HEADER DESCRIPTION
  142. // ***    
  143.  
  144.  
  145. struct MADSpec
  146. {
  147.     long        MAD;                        // Mad Identification: MADG in version 2.0
  148.     char         name[ 32];                    // Music's name
  149.     char        infos[ 256];                // Informations & Author name of the music
  150.     Byte        numPat;                    // Patterns number
  151.     Byte        numChn;                    // Channels number
  152.     Byte         numPointers;                // Partition length
  153.     Byte        oPointers[ 256];            // Partition : Patterns ID List
  154.     short        speed;                        // Default speed
  155.     short        tempo;                        // Default tempo
  156.     InstrData     fid[ 64];                    // Instruments description
  157. };
  158. typedef struct MADSpec MADSpec;
  159.  
  160. #if defined(powerc) || defined (__powerc)
  161. #pragma options align=reset
  162. #else
  163. #if !defined(THINK_C)
  164. #pragma options align=reset
  165. #endif
  166. #endif
  167. #endif